﻿@model ProfilePostsModel
@using Nop.Web;
@using Nop.Web.Extensions;
@using Nop.Web.Models.Profile;
<div class="user-last-posts">
    <div class="section-title">
        @if (Model.Posts.Count > 0)
        {
            <table class="posts-table">
                <col />
                <tbody>
                    @for (int i = 0; i < Model.Posts.Count; i++)
                    {
                        var item = Model.Posts[i];
                        <tr>
                            <td class="a-left">
                                <div class="topic">
                                    <div class="topictitle">
                                        <span>@T("Profile.Topic")</span>:
                                        @Html.RouteLink(item.ForumTopicTitle, "TopicSlug", new { id = item.ForumTopicId, slug = item.ForumTopicSlug })
                                    </div>
                                    <div class="topicbody">
                                        <span>@Html.Raw(item.ForumPostText)</span></div>
                                    <div class="topicdata">
                                        <span>
                                            @T("Profile.PostedOn")</span>: <span>@item.Posted</span></div>
                                </div>
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        }
        else
        {
            @T("Profile.LatestPosts.NoPosts")
        }
        @if (Model.PagerModel.TotalPages > 1)
        {
            <div class="latestpostsgridpagerstyle">
                @Html.Pager(Model.PagerModel)
            </div>
        }
    </div>
</div>
